Fix which-key-show-remaining-keys option
authorJustin Burkett <justin@burkett.cc>
Tue, 30 May 2017 12:25:52 +0000 (08:25 -0400)
committerJustin Burkett <justin@burkett.cc>
Tue, 30 May 2017 12:26:33 +0000 (08:26 -0400)
which-key.el

index 6e4ffeaf76a8df5f27bf8bd10939869edc25221c..d3b619c1124f8b3c1fa1dfcbe6841a6c0e3464d6 100644 (file)
@@ -590,8 +590,6 @@ Used when `which-key-popup-type' is frame.")
   "Internal: Backup the value of `prefix-help-command'.")
 (defvar which-key--pages-plist nil
   "Internal: Holds page objects")
-(defvar which-key--lighter-backup nil
-  "Internal: Holds lighter backup")
 (defvar which-key--current-prefix nil
   "Internal: Holds current prefix")
 (defvar which-key--current-page-n nil
@@ -979,6 +977,7 @@ total height."
     (when (and which-key-idle-secondary-delay
                which-key--secondary-timer-active)
       (which-key--start-timer))
+    (which-key--lighter-restore)
     (cl-case which-key-popup-type
       ;; Not necessary to hide minibuffer
       ;; (minibuffer (which-key--hide-buffer-minibuffer))
@@ -1764,8 +1763,6 @@ is the width of the live window."
   (when which-key-show-remaining-keys
     (let ((n-shown (nth page-n (plist-get which-key--pages-plist :keys/page)))
           (n-tot (plist-get which-key--pages-plist :tot-keys)))
-      (setq which-key--lighter-backup
-            (cadr (assq 'which-key-mode minor-mode-alist)))
       (setcar (cdr (assq 'which-key-mode minor-mode-alist))
               (format " WK: %s/%s keys" n-shown n-tot)))))
 
@@ -1773,7 +1770,7 @@ is the width of the live window."
   "Restore the lighter for which-key."
   (when which-key-show-remaining-keys
     (setcar (cdr (assq 'which-key-mode minor-mode-alist))
-            which-key--lighter-backup)))
+            which-key-lighter)))
 
 (defun which-key--echo (text)
   "Echo TEXT to minibuffer without logging."